package fsoft.com.vn.directory.dao;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import fsoft.com.vn.directory.form.Login;

@Repository
public class LoginDAOImpl implements LoginDAO {

	@Autowired
	private SessionFactory sessionFactory;

	public Login checklogin(String name, String pass) {

		Query q = sessionFactory.getCurrentSession().createQuery(
				"from Login where name = '" + name + "' AND pass = '"+ pass +"'");

		return (Login) q.uniqueResult();

	}
}
